from wtforms import Form,StringField,IntegerField
from wtforms.validators import length, NumberRange,DataRequired


class SearchFrom(Form):
    q=StringField(validators=[DataRequired(message='搜索条件不能为空'),length(min=1,max=15,message='长度不能超过15位')])
    page=IntegerField(validators=[NumberRange(min=1,max=99)],default=1) #这里默认值设置了无效

